<template>
  <div class="introduceBox">
    <div class="imgBox">
      <img :src="detailObj.picUrl" alt="" />
    </div>
    <div class="introduceBoxRight">
      <div class="introduceBoxTitle">
        <p class="label"></p>
        <div class="songSheetName" :title="detailObj.name">
          {{ detailObj.name }}
        </div>
      </div>
      <div class="userBox">
        <img
          class="userImg"
          :src="detailObj.dj && detailObj.dj.avatarUrl"
          alt=""
        />
        <span class="nickname">{{
          detailObj.dj && detailObj.dj.nickname
        }}</span>
      </div>
      <div class="btnBox">
        <div class="btnClass subscribeBtn">
          <i>订阅({{ detailObj.subCount }})</i>
        </div>
        <div class="btnClass playBtn">
          <i>播放全部</i>
        </div>
        <div class="btnClass forward">
          <i>分享({{ detailObj.shareCount | numChange }})</i>
        </div>
      </div>
      <p class="descriptionte">
        <span class="category">{{ detailObj.category }}</span
        >{{ detailObj.desc }}
      </p>
    </div>
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  props: {
    detailObj: {
      type: Object,
      default: {},
    },
  },
  filters: {
    numChange(num) {
      if (num > 99999) {
        return parseInt(num / 10000) + "万";
      } else {
        return num;
      }
    },
  },
  methods: {
    ...mapActions("musicStore", ["songSheetPlay", "addMusicList"]),
  },
};
</script>

<style lang="scss" scoped>
.introduceBox {
  width: 100%;
  display: flex;
  .imgBox {
    width: 200px;
    height: 200px;
    padding: 2px;
    border: 1px solid #ccc;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .introduceBoxRight {
    flex: 1;
    overflow: hidden;
    margin-left: 30px;
    .introduceBoxTitle {
      display: flex;
      .label {
        width: 54px;
        height: 24px;
        background: url("./../../assets/imges/btnIconTwo.png") no-repeat 0 -1014px;
        margin-right: 10px;
      }
      .songSheetName {
        flex: 1;
        line-height: 24px;
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
    .userBox {
      display: flex;
      align-items: center;
      margin: 12px 0 20px;
      .userImg {
        width: 35px;
        height: 35px;
      }
      .nickname {
        color: #0c73c2;
        margin: 0 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
    .btnBox {
      .btnClass {
        color: #333;
        background: url("./../../assets/imges/backgroundStripe.png") no-repeat
          right -1020px;
        padding: 0 5px 0 0;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
        margin-right: 5px;
        i {
          padding-right: 2px;
          padding-left: 28px;
          height: 31px;
          line-height: 30px;
          display: inline-block;
          min-width: 23px;
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -977px;
          cursor: pointer;
        }
      }
      .forward {
        i {
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -1225px;
        }
      }
      .playBtn {
        i {
          background-position: 0 -2285px;
        }
      }
      .subscribeBtn {
        background-position: right -2163px;
        color: #fff;
        i {
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -2125px;
        }
      }
    }
    .descriptionte {
      margin-top: 30px;
      color: #666;
      line-height: 18px;
      .category {
        margin-right: 7px;
        border: 1px solid #999;
        color: #cc0000;
        border-color: #cc0000;
        display: inline-block;
        padding: 0 6px;
        line-height: 16px;
        vertical-align: middle;
        font-size: 12px;
      }
    }
  }
}
</style>